> Shouldn't the object itself be responsible for what it contains and what is relevant rather than an outside entity?
Absolutely...here are three reasons that come to mind:
1) Control over what is persistent (vs. transient). This feature can dramatically effect the size of the composite object (and associated cost to activate it from disk).
2) Data that needs to be converted on read/write (e.g. ports, file descriptors...i.e. any data that has different meanings across process boundaries).
3) Version control for converting old objects to new objects...the object database folks call this "schema evolution" (sounds fancy). NeXTSTEP objects can read old versions of themselves without any problem...we don't force the application to evolve all nib files in concert. This flexibility is very hard to achieve without involving the object.
Schemes that do not have these capabilities are usually not very useful for building real applications.
snaroff
From stb!michael@cs.ucla.edu Wed Sep 16 23:33:21 1992
Return-Path: <stb!michael@cs.ucla.edu>
Received: from albert.gnu.ai.mit.edu by carrara.bos.marble.com (NX5.67c/Marble-3.0)
id AA04081; Wed, 16 Sep 92 23:33:18 -0400
Received: from life.ai.mit.edu by albert.gnu.ai.mit.edu (5.65/4.0) with SMTP
id <AA06652@albert.gnu.ai.mit.edu>; Wed, 16 Sep 92 23:11:01 -0400
Received: from aeneas.MIT.EDU by life.ai.mit.edu (4.1/AI-4.10) id AA29959; Wed, 16 Sep 92 23:01:53 EDT
Received: from Kona.CS.UCLA.EDU by aeneas.MIT.EDU (5.61/4.7) id AA15838; Wed, 16 Sep 92 23:01:50 -0400
Received: from stb.UUCP by kona.cs.ucla.edu
(Sendmail 5.61d+YP/3.20) id AA16723;
Wed, 16 Sep 92 20:00:31 -0700
Received: by stb.info.com (/\==/\ Smail3.1.20.1 #20.13)
id <m0mVBlL-0005OXC@stb.info.com>; Wed, 16 Sep 92 19:38 PDT
Message-Id: <m0mVBlL-0005OXC@stb.info.com>
Date: Wed, 16 Sep 92 19:38 PDT
From: michael@stb.info.com (Michael Gersten)
Received: by NeXT Mailer (1.63)
To: ucla-cs!prep.ai.mit.edu!gnu-objc@cs.ucla.edu
Subject: Auto persistance of objects: A comprimise
Here's a possible solution:
If you don't want Object to have a default way of reading and writting all objects, why not have some tool that reads a .h file, and generates a read: and write: method to do default archiving?
This way all objects get one by default, and you can customize it if you want to.
Michael
--
Michael Gersten michael@stb.info.com
HELLO! I'm a signature virus! Join in the fun and copy me into yours!